package lab02.Test19;

import java.util.Scanner;

/**
 * Created by Culle on 2017-11-1.
 */
public class change {
    private static String Scan;

    private static StringBuffer change(String str){
        String upStr = str.toUpperCase();
        String lowStr = str.toLowerCase();
        StringBuffer buf = new StringBuffer(str.length());
        for (int i = 0, k = str.length(); i < k; i++) {
            {
                if (str.charAt(i) == upStr.charAt(i)) {
                    buf.append(lowStr.charAt(i));
                } else {
                    buf.append(upStr.charAt(i));
                }
            }
        }
        return buf;
    };

    public static void main(String[] args) {
        System.out.println("Please input :");
        Scanner scan = new Scanner(System.in);
        StringBuffer ss = change(Scan);
        System.out.println("大小写转换后是:" + change(Scan));
        System.out.println("倒序输出后是:" + ss.reverse());
    }
}
